package edu.ccut.saturn.component.impl.sql;

import edu.ccut.saturn.component.xml.ISaturnElement;

public abstract class AbstractDyadicExprSqlItemInfo extends
		AbstractSingleExprSqlItemInfo {

	private String comparedValue;

	private boolean isProperty = false;

	public String getComparedValue() {
		return comparedValue;
	}

	public void setComparedValue(String comparedValue) {
		this.comparedValue = comparedValue;
	}

	public AbstractDyadicExprSqlItemInfo(String prepend, String property,
			String comparedValue, boolean isProperty) {

		super(prepend, property);
		this.comparedValue = comparedValue;
		this.isProperty = isProperty;
	}

	public boolean isProperty() {
		return isProperty;
	}

	public void setProperty(boolean isProperty) {
		this.isProperty = isProperty;
	}

	@Override
	public ISaturnElement toSaturnElement() {
		ISaturnElement element = super.toSaturnElement();
		element.addAttribute("comparedValue", this.comparedValue);
		element.addAttribute("isProperty", String.valueOf(this.isProperty));
		return element;
	}
}
